<div class='form'>
  <% form_for @category,:html=>{:multipart=>true} do |f| %>
    <%= f.error_messages %>

    <p>
      <label for="category_parent_id">父类</label>
      <%=  select("category", "parent_id",categories_options,{:include_blank => true }) %>
      </p>

      <p>
        <label for="category_name">名称</label>
        <%= f.text_field :name %>
      </p>

      <p>
        <label for="category_image─url">上传图片</label>
        <%= file_column_field "category", "image_url" %>
      </p>

      <p>
        <label for="category_description">描述</label>
        <%= f.text_area :description,:cols=>30,:rows=>3 %>
      </p>
      <p>
        <label for="category_unit">单位</label>
        <%=select("category", "unit",Category::UNITS,:prompt => "请选择..")%>
      </p>

      <p>
        <label for="category_show_in_nav">导航可见</label>
        <%= f.check_box :show_in_nav %>
      </p>
      <p>
        <label for="category_active">可用</label>
        <%= f.check_box :active %>
      </p>

      <p>
        <%= f.submit button_name,:class=>'submit' %>
        <%= link_to '编辑属性',category_properties_path(@category) %>
      </p>
    <% end %>
  </div>